package com.fishery.authority.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fishery.authority.entity.FunctionRole;
import com.fishery.authority.mapper.FunctionRoleMapper;
import com.fishery.authority.service.FunctionRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hy
 * @since 2021-01-18
 */
@Service
public class FunctionRoleServiceImpl extends ServiceImpl<FunctionRoleMapper, FunctionRole> implements FunctionRoleService {

    /**
     * 根据角色获取权限
     *
     * @param roleId
     * @return
     */
    @Override
    public List<FunctionRole> selectByRoleId(String roleId) {
        QueryWrapper<FunctionRole> wrapper = new QueryWrapper<>();
        wrapper.eq("role_id", roleId);
        List<FunctionRole> functionRoles = baseMapper.selectList(wrapper);
        return functionRoles;
    }
}
